import {SegmentDateScope} from 'lib/components/SegmentDatePicker.jsx'

import BaseScope from '../common/baseScope.es6'

import PerformanceScope from './PerformanceScope.es6'
import NetGridScope from './NetGridScope.es6'
import ResponseDistributionScope from './ResponseDistributionScope.es6'
import GeoScope from './GeoScope.es6'
import HealthExaminationScope from './HealthExaminationScope.es6'

export default class RootScope extends BaseScope {
  constructor(props, context) {
    super(props, context);

    this.dateType = SegmentDateScope.getValue();
    this.dataSource = [
      new PerformanceScope(this),
      new NetGridScope(this),
      new ResponseDistributionScope(this),
      new GeoScope(this),
      new HealthExaminationScope(this)
    ];
  }

  $set_segment_date(payload) {
    this.dateType = payload.item.value;

    this.$load();
  }
}
